package com.example.demo.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.util.StringUtils;
@Data
@AllArgsConstructor
public class ResponseEntity<T> {

    private  Integer  code;
    private  String message;

    private  T data;

    // 工具类 一般都有静态方法  ：success，failed
    // 200 是成功    failed 500
    public  static ResponseEntity success(String msg){
        return  new ResponseEntity(200,msg,null);
    }

    public  static ResponseEntity failed(String msg){
        return  new ResponseEntity(500,msg,null);
    }


}
